class Person {
  constructor () {
    this.name = 'Lear'
    this.sex = 'male'
  }
  getInfo () {
    return this.name + ', ' + this.sex
  }
}
class Student extends Person {
  constructor () {
    super()
    this.name = 'Sue'
    this.sex = 'Female'
  }
  print () {
    return super.getInfo()
  }
}
let stud = new Student()
// 主要还是一个this指向问题
console.log(stud.print()) // Sue Female
console.log(stud.getInfo()) // Sue Female
